#include <iostream>
#include <string>
using std::cout;
using std::endl;
using std::string;

class Computer{
public:
    static Computer & get_instance(){
        static Computer c1("iqoo",4500);
        return c1;
    } 

    Computer &operator=(const Computer &) = delete;
    Computer (const Computer &) = delete;

    void print(){
        cout<<"brand:"<<_brand<<",price:"<<_price<<endl;
    }

private:
    Computer(const string &brand,float price)
        :_brand(brand)
         ,_price(price)
    {}

    string _brand;
    float _price;
};


void test(){
    Computer &c1 =  Computer::get_instance();
    Computer &c2 =  Computer::get_instance();
    // Computer c3("nihao",123);error
    // Computer c4 = c1;error
    // Computer c5;error

    cout<<&c1<<":"<<&c2<<endl;
    c1.print();
    c2.print();
}

int main()
{

    test ();
    return 0;
}

